﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Passwords.DAL;

namespace Passwords.Utils
{
    public static class PasswordErrorUtil
    {
        public static string AsString(this PasswordError error)
        {
            switch (error)
            {
                case PasswordError.Success: return string.Empty;
                case PasswordError.Failed: return "Could not change password: unkown error.";
                case PasswordError.NoMatch: return "The passwords you entered did not match.";
                case PasswordError.WrongPassword: return "The current password does not match.";
                case PasswordError.TooShort: return "Password length must be at least 4 characters.";
                default: throw new NotSupportedException();
            }
        }
    }
}
